/* 
 * Recursive inclusion prevention mechanism for main header file
 * Standard C preprocessor technique to prevent multiple inclusions of the same header
 * Ensures all definitions and declarations are processed only once per compilation unit
 * Maintains compilation efficiency and prevents redefinition conflicts
 */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

/* 
 * System header inclusion section for standard C libraries
 * Comprehensive collection of POSIX and standard C library headers
 * Provides fundamental system interfaces, data structures, and utility functions
 * Essential for cross-platform compatibility and system-level programming
 */
/* Includes ------------------------------------------------------------------*/

/* 
 * Error number handling and definition header
 * Provides errno variable and error code definitions for system call error reporting
 * Essential for robust error handling and system operation status checking
 */
#include <errno.h>

/* 
 * File control operations header
 * Defines file descriptor operations and control functions like open, close, fcntl
 * Supports non-blocking I/O operations and file status manipulation
 */
#include <fcntl.h>

/* 
 * Memory allocation functions header
 * Provides dynamic memory management functions like malloc, free, realloc
 * Essential for heap memory management and dynamic data structure creation
 */
#include <malloc.h>

/* 
 * POSIX threads (pthread) programming interface
 * Defines multithreading functions and synchronization primitives
 * Supports concurrent execution and parallel processing capabilities
 */
#include <pthread.h>

/* 
 * Password structure and user database operations
 * Provides access to user account information and password database
 * Used for user authentication and privilege management operations
 */
#include <pwd.h>

/* 
 * Signal handling definitions and functions
 * Defines signal types and signal handling mechanisms for process control
 * Supports interrupt handling and process communication via signals
 */
#include <signal.h>

/* 
 * Variable argument handling macros and functions
 * Provides support for functions with variable number of arguments
 * Essential for printf-style formatting and flexible function interfaces
 */
#include <stdarg.h>

/* 
 * Boolean type and value definitions
 * Provides bool type and true/false constants for logical operations
 * Enhances code readability with explicit boolean semantics
 */
#include <stdbool.h>

/* 
 * Standard input/output functions header
 * Defines file I/O operations, printf/scanf functions, and stream handling
 * Core library for console I/O and file operations
 */
#include <stdio.h>

/* 
 * Standard library functions header
 * Provides general utility functions including memory allocation, conversion, and system calls
 * Includes exit, atoi, rand, and other fundamental C library functions
 */
#include <stdlib.h>

/* 
 * String manipulation functions header
 * Defines string handling functions like strlen, strcpy, strcmp, memcpy
 * Essential for text processing and buffer manipulation operations
 */
#include <string.h>

/* 
 * Terminal I/O interface and control functions
 * Provides terminal device control and serial communication configuration
 * Used for UART/serial port configuration and line discipline settings
 */
#include <termios.h>

/* 
 * Time and date functions header
 * Defines time manipulation functions and data structures for temporal operations
 * Supports system time access, formatting, and timing measurements
 */
#include <time.h>

/* 
 * POSIX operating system API for process control
 * Provides system call wrappers for process management and file operations
 * Includes sleep, fork, exec, and other process-related functions
 */
#include <unistd.h>

/* 
 * Directory handling functions and structures
 * Defines directory traversal functions and directory entry structures
 * Supports file system navigation and directory content enumeration
 */
#include <dirent.h>

/* 
 * Network interface configuration and control headers
 * Collection of networking-related headers for socket programming and interface management
 * Essential for network communication and interface configuration operations
 */

/* 
 * Network interface definitions and structures
 * Defines interface-related constants and data structures for network configuration
 * Supports network interface enumeration and status querying
 */
#include <net/if.h>

/* 
 * I/O control operations header
 * Provides device-specific control functions via ioctl system call
 * Used for device configuration and low-level hardware control
 */
#include <sys/ioctl.h>

/* 
 * I/O multiplexing with select system call
 * Defines select function for synchronous I/O multiplexing across multiple file descriptors
 * Supports efficient handling of multiple I/O channels simultaneously
 */
#include <sys/select.h>

/* 
 * Socket programming interface and network communication
 * Defines socket functions, address structures, and network protocol support
 * Core header for TCP/IP networking and inter-process communication
 */
#include <sys/socket.h>

/* 
 * File status information and permissions
 * Defines file metadata structures and file system operation functions
 * Supports file attribute checking and permission management
 */
#include <sys/stat.h>

/* 
 * Time definitions and high-resolution timing
 * Provides timeval structure and time-related system calls
 * Supports microsecond-precision timing and timeout operations
 */
#include <sys/time.h>

/* 
 * Primitive system data types definitions
 * Defines basic system types like pid_t, size_t, and other platform-specific types
 * Ensures consistent type definitions across different system architectures
 */
#include <sys/types.h>

/* 
 * Application-specific header file inclusions
 * Custom module headers that define application-specific interfaces and data structures
 * Organized by functional modules for maintainable code architecture
 */
/**main process*/

/* 
 * Command line option parsing interface
 * Provides command line argument processing functionality for application configuration
 * Supports flexible command line interface with option and parameter handling
 */
#include "cs_getopt.h"

/* 
 * Utility functions and common service module
 * Contains general-purpose utility functions and system service implementations
 * Provides reusable code components for common programming tasks
 */
#include "unit.h"

/**log init*/

/* 
 * Log management system interface
 * Defines logging functions, log levels, and log message formatting
 * Supports systematic logging for debugging and operational monitoring
 */
#include "log_manage.h"

/**json*/

/* 
 * JSON parsing and generation library
 * Provides complete JSON data structure manipulation and serialization capabilities
 * Essential for configuration file processing and data interchange formats
 */
#include "cJSON.h"

/**uart*/

/* 
 * UART serial communication interface
 * Defines serial port configuration and data transmission functions
 * Supports modem communication and device interfacing via serial ports
 */
#include "uart.h"

/**define & config*/

/* 
 * Access Point Name (APN) configuration management
 * Defines APN data structures and configuration manipulation functions
 * Manages cellular network APN settings for mobile data connectivity
 */
#include "apn.h"

/* 
 * System configuration management interface
 * Defines configuration data structures and persistent storage functions
 * Handles application settings and parameter management across system restarts
 */
#include "config.h"

/* 
 * Modem device control and management interface
 * Defines modem communication protocols and device control functions
 * Supports cellular modem initialization, status monitoring, and command processing
 */
#include "modem.h"

/* 
 * Network routing configuration and management
 * Defines routing table manipulation functions and route configuration utilities
 * Manages network routing policies and interface prioritization
 */
#include "route.h"

/* 
 * WWAN (Wireless Wide Area Network) configuration constants
 * Defines cellular network parameters, limits, and configuration constraints
 * Provides WWAN-specific constants and network technology definitions
 */
#include "wwan_conf.h"

/* 
 * MQTT client implementation and messaging interface
 * Defines MQTT protocol functions for publish/subscribe messaging patterns
 * Supports IoT communication and remote device management via MQTT broker
 */
#include "mqtt_client.h"

/* 
 * Application-specific macro definitions and constants
 * Defines commonly used values and status indicators for consistent code semantics
 * Provides meaningful names for magic numbers and frequently used values
 */
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

/* 
 * Standard flag values for boolean state management
 * SET and RESET provide semantic clarity for flag manipulation operations
 * Enhances code readability compared to raw 1/0 values
 */
#define SET 1
#define RESET 0

/* 
 * Boolean truth value definition with compatibility checking
 * Provides TRUE constant for logical true conditions with backward compatibility
 * Ensures consistent boolean semantics across the entire codebase
 */
#ifndef TRUE
#define TRUE 1
#endif

/* 
 * Boolean false value definition with compatibility checking
 * Provides FALSE constant for logical false conditions with backward compatibility
 * Maintains consistent boolean logic throughout the application
 */
#ifndef FALSE
#define FALSE 0
#endif

/* 
 * End of main header file inclusion protection
 * Closes the #ifndef __MAIN_H preprocessor conditional block
 * Completes the recursive inclusion prevention mechanism for the main header
 */
#endif /* __MAIN_H */